package model

import (
	"engine/consts"
	"time"
)

type CoreUserHasRole struct {
	RoleId    uint64              `gorm:"column:role_id;type:bigint(20) unsigned;" json:"roleId"`
	Module    consts.SystemModule `gorm:"column:module;type:varchar(255);NOT NULL" json:"module"`
	UserId    uint64              `gorm:"column:user_id;type:bigint(20) unsigned;NOT NULL" json:"userId"`
	CreatedAt time.Time           `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP;NOT NULL" json:"createdAt" swaggertype:"string"`
	UpdatedAt *time.Time          `gorm:"column:updated_at;type:timestamp" json:"updatedAt" swaggertype:"string" extensions:"x-nullable"`
}

func (*CoreUserHasRole) TableName() string {
	return "core_user_has_roles"
}
